#!/bin/bash

export CXX=g++
export CC=gcc

LibName=librabbitmq

rm -rf Lib Include

cd Source/rabbitmq-c
rm -rf build

mkdir build
cd build
cmake ..
make

if [ ! -f ./$LibName/$LibName.a ]; then
	echo "Failed to compile $LibName.a"
	return 1
fi

mkdir ../../../Lib
mkdir ../../../Include

cp -a $LibName/$LibName.* ../../../Lib/

cd ..
cp $LibName/*.h ../../Include/
